<template>
  <div>
    <el-row v-for="patientRecord in patientRecords" :key="patientRecord.id">
    <el-descriptions :slot-scope="patientRecord" class="margin-top" title="" :column="3"  border>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-user"></i>
        病人姓名
      </template>
      <el-input :value="patientRecord.patient"></el-input>
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-office-building"></i>
        年龄
      </template>
      <el-input :value="patientRecord.age"></el-input>
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-office-building"></i>
        性别
      </template>
      <el-input :value="patientRecord.sex"></el-input>
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-mobile-phone"></i>
        手机号
      </template>
      <el-input :value="patientRecord.tel"></el-input>
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-s-custom"></i>
        身份证号
      </template>
      <el-input :value="patientRecord.idCard"></el-input>
    </el-descriptions-item>


    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-office-building"></i>
        联系地址
      </template>
      <el-input :value="patientRecord.address"></el-input>
    </el-descriptions-item>

    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-date"></i>
        病历创建时间
      </template>
      <el-input :value="patientRecord.ciDate"></el-input>
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-user"></i>
        医生姓名
      </template>
      <el-input :value="patientRecord.doctor"></el-input>
    </el-descriptions-item>
    
    <el-descriptions-item>
    </el-descriptions-item>

    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-tickets"></i>
        病情描述
      </template>
      <el-input type="textarea"
      :autosize="{ minRows: 4, maxRows: 8}"
       :value="patientRecord.ciDescription"></el-input>
    </el-descriptions-item>
  </el-descriptions>
  <br>
</el-row>
  </div>
</template>

<script>
export default {
    data(){
        return{
            //病人id
            caseId:'',
            doctor:{},
            patientRecord:{},
            patientRecords:[],
            pageNum:'1',
            pageSize:'5',
            total:'',
            dialogVisible: false,
            form: {
                ciDescription: '',
                ciCaseId: ''
            }
        }
    },
    methods:{
        queryPatientRecords(){
            let pageParam={}
            pageParam.pageNum=this.pageNum
            pageParam.pageSize=this.pageSize
            this.patientRecord.ciCaseId=this.caseId
            pageParam.param=this.patientRecord;
            this.$axios.post("api/doctor/selectCase",pageParam)
            .then(res=>{
                if(res.data.code==200){
                let pageInfo=res.data.data
                this.patientRecords=pageInfo.list
                this.pageNum=pageInfo.pageNum
                this.pageSize=pageInfo.pageSize
                this.total=pageInfo.total
            }
            })
        },
        //查找医生信息
        queryDoctor(){
        this.$axios.get("api/doctor/queryDoctor")
        .then(res=>{
            if(res.data.code==200){
                this.doctor=res.data.data;
            }
        })
        },
    },
    created(){},
    mounted(){
        this.caseId = this.$route.query.caseId
        this.queryPatientRecords()
        this.queryDoctor()
    }
}
</script>

<style>

</style>